package com.xian.createobject;

public class Test {
    public static void main(String[] args) {
        //目标：自己设计对象并使用
        Car c = new Car();
        c.name = "奔驰GLC";
        c.price = 39.78;
        System.out.println(c.name);
        System.out.println(c.price);

        c.start();
        c.run();

        Car c2 = new Car();
        c2.name = "宝马X3";
        c2.price = 39.98;
        System.out.println(c2.name);
        System.out.println(c2.price);

        c2.start();
        c2.run();
    }
}
